/*
 * Copyright (c) 2001-2023 cnstrong.cn Corporation Limited. All rights reserved.
 * This software is the confidential and proprietary information of cnstrong.cn Company.
 * ("Confidential Information").
 * You shall not disclose such Confidential Information and shall use it only
 * in accordance with the terms of the license agreement you entered into with cnstrong.cn.
 */
package com.tree.config.repository;

import com.tree.config.repository.dataobject.ProjectConfigDefineDO;
import com.tree.config.repository.dataobject.ProjectConfigValueDO;
import com.tree.config.repository.po.ProjectConfigDefinePO;
import com.tree.config.repository.po.ProjectConfigValuePO;

import java.util.List;

/**
 * 数据仓储
 *
 * @author Braveheart
 * @version V1.0
 * @since 2023-12-28
 */
public interface WeTreeRepository {

    /**
     * 统一获取字典数据，结果为json格式
     */
    String getDictCommon(String projectCode, String parentCfgCode, String currCfgCode, Object bizId);

    /**
     * 查询缓存
     *
     */
    String findCache(String codisKey);

    <T> String findCache(String bizId, Class<T> clz);

    /**
     * 缓存列表
     *
     */
    void cache(String codisKey, String cacheVal);

    <T> void cache(String bizId, Class<T> clz, String cacheVal);

    /**
     * 清除缓存
     */
    void clearCache(String codisKey);

    <T> void clearCache(String bizId, Class<T> clz);

    /**
     * 查询字典定义
     */
    List<ProjectConfigDefineDO> listConfigDefine(ProjectConfigDefinePO configDefinePO);

    /**
     * 查询字典配置
     */
    List<ProjectConfigValueDO> listConfigValue(ProjectConfigValuePO configValuePO);

}
